package tw.asap.plus.entity.response;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;

/**
 * Description:
 * Created:      [15/11/9]
 * Author:       [Yang]
 **/
public class GoodsInfo implements Parcelable {

    /**
     * item_class : 分类名称
     * item_list : [{"img":"商品图片","tags":"店长推荐","price":"现价","title":"商品名称","price_init":"原价","sales_nums":"销售数量","id":"商品id","unit":"单位"}]
     */

    private String item_class;
    /**
     * img : 商品图片
     * tags : 店长推荐
     * price : 现价
     * title : 商品名称
     * price_init : 原价
     * sales_nums : 销售数量
     * id : 商品id
     * unit : 单位
     */

    private List<ItemListEntity> item_list;

    public void setItem_class(String item_class) {
        this.item_class = item_class;
    }

    public void setItem_list(List<ItemListEntity> item_list) {
        this.item_list = item_list;
    }

    public String getItem_class() {
        return item_class;
    }

    public List<ItemListEntity> getItem_list() {
        return item_list;
    }

    public static class ItemListEntity implements Parcelable {

        private String img;
        private String tags;
        private String price;
        private String title;
        private String price_init;
        private String sales_nums;
        private String id;
        private String unit;

        public void setImg(String img) {
            this.img = img;
        }

        public void setTags(String tags) {
            this.tags = tags;
        }

        public void setPrice(String price) {
            this.price = price;
        }

        public void setTitle(String title) {
            this.title = title;
        }

        public void setPrice_init(String price_init) {
            this.price_init = price_init;
        }

        public void setSales_nums(String sales_nums) {
            this.sales_nums = sales_nums;
        }

        public void setId(String id) {
            this.id = id;
        }

        public void setUnit(String unit) {
            this.unit = unit;
        }

        public String getImg() {
            return img;
        }

        public String getTags() {
            return tags;
        }

        public String getPrice() {
            return price;
        }

        public String getTitle() {
            return title;
        }

        public String getPrice_init() {
            return price_init;
        }

        public String getSales_nums() {
            return sales_nums;
        }

        public String getId() {
            return id;
        }

        public String getUnit() {
            return unit;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.img);
            dest.writeString(this.tags);
            dest.writeString(this.price);
            dest.writeString(this.title);
            dest.writeString(this.price_init);
            dest.writeString(this.sales_nums);
            dest.writeString(this.id);
            dest.writeString(this.unit);
        }

        public ItemListEntity() {
        }

        protected ItemListEntity(Parcel in) {
            this.img = in.readString();
            this.tags = in.readString();
            this.price = in.readString();
            this.title = in.readString();
            this.price_init = in.readString();
            this.sales_nums = in.readString();
            this.id = in.readString();
            this.unit = in.readString();
        }

        public static final Creator<ItemListEntity> CREATOR = new Creator<ItemListEntity>() {
            public ItemListEntity createFromParcel(Parcel source) {
                return new ItemListEntity(source);
            }

            public ItemListEntity[] newArray(int size) {
                return new ItemListEntity[size];
            }
        };
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.item_class);
        dest.writeList(this.item_list);
    }

    public GoodsInfo() {
    }

    protected GoodsInfo(Parcel in) {
        this.item_class = in.readString();
        this.item_list = new ArrayList<>();
        in.readList(this.item_list, List.class.getClassLoader());
    }

    public static final Parcelable.Creator<GoodsInfo> CREATOR = new Parcelable.Creator<GoodsInfo>() {
        public GoodsInfo createFromParcel(Parcel source) {
            return new GoodsInfo(source);
        }

        public GoodsInfo[] newArray(int size) {
            return new GoodsInfo[size];
        }
    };
}
